<?php

#[('__destruct', '析构函数')]
#[('析构函数会在到某个对象的所有引用都被删除或者当对象被显式销毁时执行')]
class User
{
    public $name = 'hflxhn';
    public function __destruct()
    {
        echo "{$this->name} end ";
    }

    public function start()
    {
        echo "my name is {$this->name} <br>";
    }
}

$obj = new User();
$obj->start();
